package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName device_fault_record
 */
@TableName(value ="device_fault_record")
@Data
public class DeviceFaultRecord {
    /**
     * 
     */
    @TableId(value = "fault_id", type = IdType.AUTO)
    private Integer faultId;

    /**
     * 
     */
    @TableField(value = "device_id")
    private Integer deviceId;

    /**
     * 
     */
    @TableField(value = "fault_time")
    private Date faultTime;

    /**
     * 
     */
    @TableField(value = "fault_description")
    private String faultDescription;

    /**
     * 
     */
    @TableField(value = "fault_level")
    private Object faultLevel;

    /**
     * 
     */
    @TableField(value = "reporter_id")
    private Integer reporterId;

    /**
     * 
     */
    @TableField(value = "repair_start_time")
    private Date repairStartTime;

    /**
     * 
     */
    @TableField(value = "repair_end_time")
    private Date repairEndTime;

    /**
     * 
     */
    @TableField(value = "repair_person")
    private String repairPerson;

    /**
     * 
     */
    @TableField(value = "repair_method")
    private String repairMethod;

    /**
     * 
     */
    @TableField(value = "repair_cost")
    private BigDecimal repairCost;

    /**
     * 
     */
    @TableField(value = "spare_parts_used")
    private String sparePartsUsed;

    /**
     * 
     */
    @TableField(value = "is_repaired")
    private Integer isRepaired;

    /**
     * 
     */
    @TableField(value = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceFaultRecord other = (DeviceFaultRecord) that;
        return (this.getFaultId() == null ? other.getFaultId() == null : this.getFaultId().equals(other.getFaultId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getFaultTime() == null ? other.getFaultTime() == null : this.getFaultTime().equals(other.getFaultTime()))
            && (this.getFaultDescription() == null ? other.getFaultDescription() == null : this.getFaultDescription().equals(other.getFaultDescription()))
            && (this.getFaultLevel() == null ? other.getFaultLevel() == null : this.getFaultLevel().equals(other.getFaultLevel()))
            && (this.getReporterId() == null ? other.getReporterId() == null : this.getReporterId().equals(other.getReporterId()))
            && (this.getRepairStartTime() == null ? other.getRepairStartTime() == null : this.getRepairStartTime().equals(other.getRepairStartTime()))
            && (this.getRepairEndTime() == null ? other.getRepairEndTime() == null : this.getRepairEndTime().equals(other.getRepairEndTime()))
            && (this.getRepairPerson() == null ? other.getRepairPerson() == null : this.getRepairPerson().equals(other.getRepairPerson()))
            && (this.getRepairMethod() == null ? other.getRepairMethod() == null : this.getRepairMethod().equals(other.getRepairMethod()))
            && (this.getRepairCost() == null ? other.getRepairCost() == null : this.getRepairCost().equals(other.getRepairCost()))
            && (this.getSparePartsUsed() == null ? other.getSparePartsUsed() == null : this.getSparePartsUsed().equals(other.getSparePartsUsed()))
            && (this.getIsRepaired() == null ? other.getIsRepaired() == null : this.getIsRepaired().equals(other.getIsRepaired()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFaultId() == null) ? 0 : getFaultId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getFaultTime() == null) ? 0 : getFaultTime().hashCode());
        result = prime * result + ((getFaultDescription() == null) ? 0 : getFaultDescription().hashCode());
        result = prime * result + ((getFaultLevel() == null) ? 0 : getFaultLevel().hashCode());
        result = prime * result + ((getReporterId() == null) ? 0 : getReporterId().hashCode());
        result = prime * result + ((getRepairStartTime() == null) ? 0 : getRepairStartTime().hashCode());
        result = prime * result + ((getRepairEndTime() == null) ? 0 : getRepairEndTime().hashCode());
        result = prime * result + ((getRepairPerson() == null) ? 0 : getRepairPerson().hashCode());
        result = prime * result + ((getRepairMethod() == null) ? 0 : getRepairMethod().hashCode());
        result = prime * result + ((getRepairCost() == null) ? 0 : getRepairCost().hashCode());
        result = prime * result + ((getSparePartsUsed() == null) ? 0 : getSparePartsUsed().hashCode());
        result = prime * result + ((getIsRepaired() == null) ? 0 : getIsRepaired().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", faultId=").append(faultId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", faultTime=").append(faultTime);
        sb.append(", faultDescription=").append(faultDescription);
        sb.append(", faultLevel=").append(faultLevel);
        sb.append(", reporterId=").append(reporterId);
        sb.append(", repairStartTime=").append(repairStartTime);
        sb.append(", repairEndTime=").append(repairEndTime);
        sb.append(", repairPerson=").append(repairPerson);
        sb.append(", repairMethod=").append(repairMethod);
        sb.append(", repairCost=").append(repairCost);
        sb.append(", sparePartsUsed=").append(sparePartsUsed);
        sb.append(", isRepaired=").append(isRepaired);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}